package org.jeecg.modules.data.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.data.entity.TDataReport;
import org.jeecg.modules.data.entity.TInvestigationRelease;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Description: t_data_report
 * @Author: jeecg-boot
 * @Date:   2025-05-20
 * @Version: V1.0
 */
public interface TDataReportMapper extends BaseMapper<TDataReport> {

    /**
     * 获取镇的数量
     */
    int getTownCount(@Param("cantCode") String cantCode, @Param("investigationId") String investigationId);

    /**
     * 获取采集点的数量
     */
    int getPointCount(@Param("cantCode") String cantCode, @Param("investigationId") String investigationId);

    /**
     * 根据区域查询平均损耗率
     */
    BigDecimal getAverageLossRate(@Param("cantCode") String cantCode, @Param("investigationId") String investigationId);

    /**
     * 统计县查看明细列表
     * @param report
     * @return
     */
    List<TDataReport> selectAreaList(TDataReport report);

    /**
     * 校验发布信息是否填报
     * @param releaseId
     * @return
     */
    Integer chkReport(@Param("releaseId") String releaseId);

    /**
     * 分页查询
     * @param page
     * @param tDataReport
     * @return
     */
    List<TDataReport> selectPageList(@Param("page") Page<TDataReport> page, @Param("report") TDataReport report);

    /**
     * 获取调查发布下的所有区域
     * @param investigationId
     * @return
     */
    List<String> getCantCode(@Param("investigationId") String investigationId);
}
